<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        // 求100项斐波那契数列

        var fibArr = [0, 1];

        for (var i = 2; i < 100; i++) {
            var p1 = fibArr[i - 2];
            var p2 = fibArr[i - 1];
            var current = p1 + p2;
            fibArr.push(current);
        }

        console.log(fibArr);

    </script>
</body>
</html>